package controller

import (
	"CloudRestaurant/service"
	"fmt"

	"github.com/gin-gonic/gin"
)

type MysqlController struct{}

func (gc *MysqlController) Router(app *gin.Engine) {
	//测试用 /api/foods?shop_id=xxx
	app.GET("/api/mysql/version", gc.GetVersion)
}

func (gc *MysqlController) GetVersion(ctx *gin.Context) {

	versionNum := service.MysqlService{}.GetVersion()
	fmt.Println("mysqlController版本：", versionNum)

	ctx.JSON(200, gin.H{
		"当前应用mysql版本是": versionNum,
	})
}
